package com.lucaswangdev.logindemo.model.mapper;

import com.lucaswangdev.logindemo.model.domain.UserDO;
import com.lucaswangdev.logindemo.model.domain.UserParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;

/**
 * UserMapper
 */
@Mapper
public interface UserMapper{
    /**
     * insert entity
     * @param userDO
     * @return
     */
    int insert(@Param("user") UserDO userDO);

    /**
     * 根据where条件count
     * @param userParam
     * @return
     */
    long countByParam(@Param("user") UserParam userParam);

    List<UserDO> selectByParam(@Param("user") UserParam userParam);

    /**
     * update selective
     * @param userDO
     * @return
     */
    int updateByPrimaryKeySelective(@Param("user") UserDO userDO);

    /**
     * 删除
     * physical delete
     * @param id
     * @return
     */
    int deleteByPrimaryKey(@Param("id") Long id);


    UserDO selectByPrimaryKey(@Param("id") Long id);


    /**
     * insert entity selective.
     * @param userParam
     * @return
     */
    int insertSelective(@Param("user") UserParam userParam);

    /**
     * batch insert entity
     * @param list
     * @return
     */
    int insertBatch(@Param("list") List<UserDO> list);

    /**
     * update
     * @param userDO
     * @return
     */
    int updateByPrimaryKey(@Param("user") UserDO userDO);

    /**
     * selectCount
     * @param user     * @return
     */
    int selectCount(@Param("user") UserDO user);

    /**
     * selectPage
     * @param user     * @return
     */
    List<UserDO> selectPage(@Param("user") UserDO user, @Param("pageable") Pageable pageable);

/** The above part of the comment is auto generated, the following part is written by the user, please do not delete this comment. */

}
